import tabbar from '@/components/tabbar'
const Home = () => import('@/views/Home')
const Mine = () => import('@/views/Mine')
const Login = () => import('@/views/Login')
const Forgetpwd = () => import('@/views/Forgetpwd')
const Register = () => import('@/views/Register')
const Reset = () => import('@/views/reset')
const Assets = () => import('@/views/assets')
const Detail = () => import('@/views/detail')
const productDetail = () => import('@/views/pointsMall/product-detail')
const commonProductDetail = () => import('@/views/product-detail')
const registerRule = () => import('@/views/register-rule')
const CourseMore = () => import('@/views/CourseMore')
const StudentPreRegister = () => import('@/views/studentPreRegister')
const StudentPreRegisterResult = () => import('@/views/studentPreRegisterResult')

const SelectStudent = () => import('@/views/selectStudent')
const ClassListList = () => import('@/views/ClassListList')
const EvaluateList = () => import('@/views/EvaluateList')
const OrderCourseList = () => import('@/views/OrderCourseList')
const orderDetail = () => import('@/views/orderDetail')
const classHistory = () => import('@/views/classHistory')
const EvalateDetail = () => import('@/views/evalateDetail')
const Schedule = () => import('@/views/Schedule')
const PointsMall = () => import('@/views/pointsMall/pointsMall')
const PurchaseHistory = () => import('@/views/pointsMall/purchaseHistory')
const CategoryProducts = () => import('@/views/pointsMall/categoryProducts')
const PointsEarnHistory = () => import('@/views/pointsMall/pointsEarnHistory')
const PointsEarnDetail = () => import('@/views/pointsMall/pointsEarnDetail')
const ClassDetail = () => import('@/views/classDetail')
export default [
  {
    path: '/evalateDetail/:id?',
    name: 'evalateDetail',
    component: EvalateDetail,
    meta: {
      title: '评价详情',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/orderCourseList',
    name: 'orderCourseList',
    component: OrderCourseList,
    meta: {
      title: '课程活动包',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacherList',
    name: 'teacherList',
    component: () => import('@/views/teacherList'),
    meta: {
      title: '师资列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacherDetail',
    name: 'teacherDetail',
    component: () => import('@/views/teacherDetail'),
    meta: {
      title: '老师详情',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/registerNow',
    name: 'registerNow',
    component: () => import('@/views/registerNow'),
    meta: {
      title: '联系我们',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/orderSuccess',
    name: 'orderSuccess',
    component: () => import('@/views/orderSuccess'),
    meta: {
      title: '报名结果',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/mine',
    name: 'teacherMine',
    component: () => import('@/views/teachers/Mine'),
    meta: {
      title: '教务中心',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/login',
    name: 'teacherLogin',
    component: () => import('@/views/teachers/login'),
    meta: {
      title: '教师端登录',
      needLogin: false,
      keepAlive: false
    }
  },
  {
    path: '/teacher/classList',
    name: 'teacherClassList',
    component: () => import('@/views/teachers/teacherClassList'),
    meta: {
      title: '课程列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/cancelClassAndEvaluate',
    name: 'cancelClassAndEvaluate',
    component: () => import('@/views/teachers/cancelClassAndEvaluate'),
    meta: {
      title: '销课列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/cancelClassStudent',
    name: 'cancelClassStudent',
    component: () => import('@/views/teachers/cancelClassStudentList'),
    meta: {
      title: '学员列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/operationComment',
    name: 'operationComment',
    component: () => import('@/views/teachers/operationComment'),
    meta: {
      title: '点评列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/teacher/comment',
    name: 'comment',
    component: () => import('@/views/teachers/comment'),
    meta: {
      title: '课堂评价',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/orderDetail',
    name: 'orderDetail',
    component: orderDetail,
    meta: {
      title: '订单详情',
      needLogin: true,
      keepAlive: true,
      isBack: false
    }
  },
  {
    path: '/classHistory/:buyId',
    name: 'class-history',
    component: classHistory,
    meta: {
      title: '课时历史',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/selectStudent',
    name: 'selectStudent',
    component: SelectStudent,
    meta: {
      title: '选择学生',
      needLogin: true,
      keepAlive: true,
      isBack: false
    }
  },
  {
    path: '/selectStudentWithTabbar',
    name: 'selectStudentWithTabbar',
    components: {
      default: SelectStudent,
      tabbar: tabbar
    },
    meta: {
      title: '选择学生',
      needLogin: true,
      keepAlive: false,
      isBack: false
    }
  },
  {
    path: '/classListList',
    name: 'classListList',
    component: ClassListList,
    meta: {
      title: '我的课表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/evaluateList',
    name: 'evaluateList',
    component: EvaluateList,
    meta: {
      title: '评价记录',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/',
    redirect: '/home',
    meta: {
      needLogin: true
    }
  },
  {
    path: '/home',
    name: 'home',
    components: {
      default: Home,
      tabbar: tabbar
    },
    meta: {
      path: 'home',
      activeIndex: 0,
      icon: require('../assets/home_icon.png'),
      active: require('../assets/home_icon_active.png'),
      keepAlive: true,
      title: '育臻教育',
      titleTab: '首页',
      isTab: true,
      needLogin: true
    }
  },
  {
    path: '/schedule',
    name: 'schedule',
    components: {
      default: Schedule,
      tabbar: tabbar
    },
    meta: {
      path: 'schedule',
      activeIndex: 1,
      icon: require('../assets/my_assets.png'),
      active: require('../assets/pdf_icon.png'),
      keepAlive: false,  // 修改为false，避免缓存问题
      title: '育臻教育',
      titleTab: '课表',
      isTab: true,
      needLogin: true
    }
  },
  {
    path: '/mine',
    name: 'mine',
    components: {
      default: Mine,
      tabbar: tabbar
    },
    meta: {
      path: 'mine',
      activeIndex: 2,
      icon: require('../assets/mine_icon.png'),
      active: require('../assets/mine_icon_active.png'),
      keepAlive: true,
      title: '育臻教育',
      titleTab: '我的',
      isTab: true,
      needLogin: true
    }
  },
  {
    path: '/login',
    name: 'login',
    components: {
      default: Login
    },
    meta: {
      title: '登录',
      needLogin: false,
      keepAlive: false
    }
  },
  {
    path: '/forgetpwd',
    name: 'forgetpwd',
    components: {
      default: Forgetpwd
    },
    meta: {
      title: '忘记密码',
      needLogin: false,
      keepAlive: false
    }
  },
  {
    path: '/register',
    name: 'register',
    components: {
      default: Register
    },
    meta: {
      title: '注册',
      needLogin: false,
      keepAlive: true
    }
  },
  {
    path: '/reset',
    name: 'reset',
    component: Reset,
    meta: {
      title: '设置',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/assets',
    name: 'assets',
    component: Assets,
    meta: {
      title: '我的课程',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/product-detail/:id?',
    name: 'product-detail',
    component: productDetail,
    meta: {
      title: '商品详情',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/common-product-detail/:id?',
    name: 'common-product-detail',
    component: commonProductDetail,
    meta: {
      title: '商品详情',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/detail',
    name: 'detail',
    component: Detail,
    meta: {
      title: '详情信息',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/register-rule',
    name: 'register-rule',
    component: registerRule,
    meta: {
      title: '注册协议',
      needLogin: false,
      keepAlive: false
    }
  },
  {
    path: '/course-more',
    name: 'course-more',
    component: CourseMore,
    meta: {
      title: '近期课程',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/studentPreRegister',
    name: 'studentPreRegister',
    component: StudentPreRegister,
    meta: {
      title: '学生信息预录',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/studentPreRegisterResult',
    name: 'studentPreRegisterResult',
    component: StudentPreRegisterResult,
    meta: {
      title: '预录结果',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/pointsMall',
    name: 'pointsMall',
    component: PointsMall,
    meta: {
      title: '积分商城',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/purchaseHistory',
    name: 'purchaseHistory',
    component: PurchaseHistory,
    meta: {
      title: '购买记录',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/categoryProducts/:categoryId',
    name: 'categoryProducts',
    component: CategoryProducts,
    meta: {
      title: '商品列表',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/pointsEarnHistory',
    name: 'pointsEarnHistory',
    component: PointsEarnHistory,
    meta: {
      title: '积分获取记录',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/pointsEarnDetail',
    name: 'pointsEarnDetail',
    component: PointsEarnDetail,
    meta: {
      title: '积分详情',
      needLogin: true,
      keepAlive: false
    }
  },
  {
    path: '/classDetail/:id?',
    name: 'class-detail',
    component: ClassDetail,
    meta: {
      title: '课程详情',
      needLogin: true,
      keepAlive: false
    }
  }
]
